﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PickGold.Arguments
{
	/// <summary>
	/// 为异步操作提供数据
	/// </summary>
	/// <typeparam name="RESULT">异步操作返回值类型</typeparam>
	public class CAsyncCompletedEventArgs<RESULT> : CAsyncCompletedEventArgs
	{
		private RESULT _Result;

		/// <summary>
		/// 初始化 CAsyncCompletedEventArgs 类的新实例。
		/// </summary>
		/// <param name="result">异步操作的返回值</param>
		/// <param name="error">在异步操作期间发生的任何错误。</param>
		/// <param name="cancelled">一个指示异步操作是否已被取消的值。</param>
		/// <param name="userState">传递给异步操作方法的、用户提供的可选状态对象。</param>
		public CAsyncCompletedEventArgs(RESULT result, Exception error, bool cancelled, object userState)
			: base(error, cancelled, userState)
		{
			this._Result = result;
		}

		/// <summary>
		/// 异步操作的返回值
		/// </summary>
		public RESULT Result
		{
			get
			{
				return this._Result;
			}
		}
	}

	/// <summary>
	/// 为异步操作提供数据
	/// </summary>
	public class CAsyncCompletedEventArgs : AsyncCompletedEventArgs
	{
		/// <summary>
		/// 初始化 CAsyncCompletedEventArgs 类的新实例。
		/// </summary>
		/// <param name="error">在异步操作期间发生的任何错误。</param>
		/// <param name="cancelled">一个指示异步操作是否已被取消的值。</param>
		/// <param name="userState">传递给异步操作方法的、用户提供的可选状态对象。</param>
		public CAsyncCompletedEventArgs(Exception error, bool cancelled, object userState)
			: base(error, cancelled, userState)
		{
			//
		}
	}
}
